﻿<Window x:Class="FriendStream.Windows.Options"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Properties="clr-namespace:FriendStream.Properties" 
        Title="{x:Static Properties:Resources.OptionsWindowTitle}" Height="480" Width="520" WindowStartupLocation="CenterScreen" MinWidth="480" MinHeight="350" Background="Transparent"
        SourceInitialized="WindowSourceInitialized" Closed="WindowClosed">
    <DockPanel Name="Root" Background="{StaticResource TabControlBgBrush}" Margin="0,34,0,0" TextOptions.TextFormattingMode="Display">
        <Grid DockPanel.Dock="Bottom">
            <Rectangle Fill="#c1c2c3" VerticalAlignment="Top" Height="1" Margin="0,0,0,0"/>
            <Rectangle VerticalAlignment="Top" Height="4" Margin="0,1,0,0">
                <Rectangle.Fill>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                        <GradientStop Color="#AAc6c9cd" Offset="0"/>
                        <GradientStop Color="#e3e7ec" Offset="1"/>
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,0,10">
                <Button Name="OkButton" Content="{x:Static Properties:Resources.OptionsOkButton}" MinWidth="75" Height="23" Margin="0,0,7,0" Click="OkButtonClick"/>
                <Button Name="CancelButton" Content="{x:Static Properties:Resources.OptionsCancelButton}" MinWidth="75" Height="23" Margin="0,0,7,0" Click="CancelButtonClick"/>
                <Button Name="ApplyButton" Content="{x:Static Properties:Resources.OptionsApplyButton}" MinWidth="75" Height="23" Margin="0,0,7,0" IsEnabled="False" Click="ApplyButtonClick"/>
            </StackPanel>
        </Grid>
        <TabControl Style="{StaticResource TabControlStyle}" Margin="0,-34,0,0">
            <TabItem Header="{x:Static Properties:Resources.OptionsGeneralTabHeader}" Style="{StaticResource TabItemStyle}">
                <ScrollViewer VerticalScrollBarVisibility="Auto" Background="White">
                    <StackPanel Orientation="Vertical" Margin="10">
                        <TextBlock FontSize="24" FontWeight="Light" Text="{x:Static Properties:Resources.OptionsSocial}" Foreground="{StaticResource OptionsBigHeaderColor}" TextOptions.TextFormattingMode="Ideal"/>
                        <Separator Margin="0,0,0,10"/>
                        <StackPanel Name="ProvidersPanel"/>

                        <StackPanel Orientation="Horizontal" Margin="0,3,0,0">
                            <TextBlock Text="{x:Static Properties:Resources.OptionsRefreshFreq}"/>
                            <TextBlock Name="RefreshFreqValueTextBlock" Text="20" Margin="5,0,3,0" FontWeight="DemiBold"/>
                        </StackPanel>

                        <DockPanel>
                            <TextBlock DockPanel.Dock="Left" Text="{x:Static Properties:Resources.OptionsLessChecks}" Margin="0,0,7,0" VerticalAlignment="Center" Foreground="Gray"/>
                            <TextBlock DockPanel.Dock="Right" Text="{x:Static Properties:Resources.OptionsMoreChecks}" Margin="7,0,0,0" VerticalAlignment="Center" Foreground="Gray"/>
                            <Slider Name="RefreshFreqSlider" Margin="0,3,0,0" Value="30" TickPlacement="Both" Minimum="5" Maximum="180" TickFrequency="5" SmallChange="10" LargeChange="10"
                                        IsSnapToTickEnabled="True" ValueChanged="RefreshFreqSliderValueChanged" IsDirectionReversed="True"/>
                        </DockPanel>

                        <TextBlock FontSize="24" FontWeight="Light" Text="{x:Static Properties:Resources.OptionsUI}" Margin="0,15,0,0" Foreground="{StaticResource OptionsBigHeaderColor}" TextOptions.TextFormattingMode="Ideal"/>
                        <Separator Margin="0,0,0,10"/>
                        <CheckBox Name="ShowTaskbarIconCheckBox" Content="{x:Static Properties:Resources.OptionsShowTaskbarIcon}" Click="CheckBoxClick"/>
                        <StackPanel Orientation="Horizontal" Margin="0,3,0,0">
                            <TextBlock Text="{x:Static Properties:Resources.OptionsSize}"/>
                            <TextBlock Name="SizeValueTextBlock" Text="100%" Margin="5,0,3,0" FontWeight="DemiBold"/>
                        </StackPanel>
                        <DockPanel>
                            <TextBlock DockPanel.Dock="Left" Text="{x:Static Properties:Resources.OptionsSizeSmaller}" Margin="0,0,7,0" VerticalAlignment="Center" Foreground="Gray"/>
                            <TextBlock DockPanel.Dock="Right" Text="{x:Static Properties:Resources.OptionsSizeLarger}" Margin="7,0,0,0" VerticalAlignment="Center" Foreground="Gray"/>
                            <Slider Name="SizeSlider" Margin="0,3,0,0" Value="100" TickPlacement="Both" Minimum="20" Maximum="100" TickFrequency="5" SmallChange="10" LargeChange="10"
                                        IsSnapToTickEnabled="True" ValueChanged="SizeSliderValueChanged"/>
                        </DockPanel>

                        <StackPanel Orientation="Horizontal" Margin="0,3,0,0">
                            <TextBlock Text="{x:Static Properties:Resources.OptionsTransparency}"/>
                            <TextBlock Name="TransparencyValueTextBlock" Text="100%" Margin="5,0,3,0" FontWeight="DemiBold"/>
                        </StackPanel>
                        <DockPanel>
                            <TextBlock DockPanel.Dock="Left" Text="{x:Static Properties:Resources.OptionsTransparencyLess}" Margin="0,0,7,0" VerticalAlignment="Center" Foreground="Gray"/>
                            <TextBlock DockPanel.Dock="Right" Text="{x:Static Properties:Resources.OptionsTransparencyMore}" Margin="7,0,0,0" VerticalAlignment="Center" Foreground="Gray"/>
                            <Slider Name="TransparencySlider" Margin="0,3,0,0" Value="100" TickPlacement="Both" Minimum="0" Maximum="100" TickFrequency="5" SmallChange="10" LargeChange="10"
                                        IsSnapToTickEnabled="True" ValueChanged="TransparencySliderValueChanged"/>
                        </DockPanel>

                        <!--<StackPanel Orientation="Horizontal" Margin="0,3,0,0">
                            <TextBlock Text="{x:Static Properties:Resources.OptionsRotationAngle}"/>
                            <TextBlock Name="RotationValueTextBlock" Text="0°" Margin="5,0,3,0" FontWeight="DemiBold"/>
                        </StackPanel>
                        <DockPanel>
                            <TextBlock DockPanel.Dock="Left" Text="{x:Static Properties:Resources.OptionsLess}" Margin="0,0,7,0" VerticalAlignment="Center" Foreground="Gray"/>
                            <TextBlock DockPanel.Dock="Right" Text="{x:Static Properties:Resources.OptionsMore}" Margin="7,0,0,0" VerticalAlignment="Center" Foreground="Gray"/>
                            <Slider Name="RotationSlider" Margin="0,3,0,0" Value="0" TickPlacement="Both" Minimum="0" Maximum="60" TickFrequency="10" SmallChange="10" LargeChange="10"
                                        IsSnapToTickEnabled="True" ValueChanged="RotationSliderValueChanged"/>
                        </DockPanel>-->

                        <TextBlock FontSize="24" FontWeight="Light" Text="{x:Static Properties:Resources.OptionsStartup}" Margin="0,15,0,0" Foreground="{StaticResource OptionsBigHeaderColor}" TextOptions.TextFormattingMode="Ideal"/>
                        <Separator Margin="0,0,0,10"/>
                        <CheckBox Name="AutostartCheckBox" Margin="0,3,0,0" Content="{x:Static Properties:Resources.OptionsAutostart}" Click="CheckBoxClick"/>

                        <TextBlock FontSize="24" FontWeight="Light" Text="{x:Static Properties:Resources.OptionsUpdates}" Margin="0,15,0,0" Foreground="{StaticResource OptionsBigHeaderColor}" TextOptions.TextFormattingMode="Ideal"/>
                        <Separator Margin="0,0,0,10"/>
                        <TextBlock Text="{x:Static Properties:Resources.OptionsUpdatesInfo}" Foreground="Gray" TextWrapping="Wrap"/>
                        <CheckBox Name="UpdatesCheckBox" Margin="0,3,0,0" Content="{x:Static Properties:Resources.OptionsCheckForUpdates}" Click="CheckBoxClick"/>
                        <CheckBox Name="SilentUpdateCheckBox" Margin="0,3,0,0" Content="{x:Static Properties:Resources.OptionsSilentUpdate}" Click="CheckBoxClick"/>

                        <StackPanel Orientation="Horizontal" Margin="0,3,0,0">
                            <TextBlock Text="{x:Static Properties:Resources.OptionsUpdateInterval}"/>
                            <TextBlock Name="UpdateFreqValueTextBlock" Text="100%" Margin="5,0,3,0" FontWeight="DemiBold"/>
                        </StackPanel>

                        <DockPanel>
                            <TextBlock DockPanel.Dock="Left" Text="{x:Static Properties:Resources.OptionsLessChecks}" Margin="0,0,7,0" VerticalAlignment="Center" Foreground="Gray"/>
                            <TextBlock DockPanel.Dock="Right" Text="{x:Static Properties:Resources.OptionsMoreChecks}" Margin="7,0,0,0" VerticalAlignment="Center" Foreground="Gray"/>
                            <Slider Name="UpdateFreqSlider" IsEnabled="{Binding ElementName=UpdatesCheckBox, Path=IsChecked}" Margin="0,3,0,0" Value="100" TickPlacement="Both" Minimum="30" Maximum="300" TickFrequency="5" SmallChange="10" LargeChange="10"
                                        IsSnapToTickEnabled="True" ValueChanged="UpdateFreqSliderValueChanged" IsDirectionReversed="True"/>
                        </DockPanel>

                        <Button Name="CheckUpdatesButton" Margin="0,3,0,0" Content="{x:Static Properties:Resources.OptionsCheckNow}" Click="CheckUpdatesButtonClick" HorizontalAlignment="Left" Padding="15,0,15,0"/>


                        <TextBlock FontSize="24" FontWeight="Light" Text="{x:Static Properties:Resources.OptionsLanguage}" Margin="0,15,0,0" Foreground="{StaticResource OptionsBigHeaderColor}" TextOptions.TextFormattingMode="Ideal"/>
                        <Separator Margin="0,0,0,10"/>
                        <ComboBox Name="LanguageComboBox" SelectionChanged="ComboBoxSelectionChanged"/>
                        <TextBlock Text="{x:Static Properties:Resources.OptionsRestart}" Margin="0,3,0,0" Foreground="Gray"/>
                    </StackPanel>
                </ScrollViewer>
            </TabItem>
            <TabItem Header="{x:Static Properties:Resources.OptionsStyleTabHeader}" Style="{StaticResource TabItemStyle}">
                <ScrollViewer VerticalScrollBarVisibility="Auto" Background="White">
                    <StackPanel Orientation="Vertical" Margin="10">
                        <TextBlock FontSize="24" FontWeight="Light" Text="{x:Static Properties:Resources.OptionsChooseStyle}" Foreground="{StaticResource OptionsBigHeaderColor}" TextOptions.TextFormattingMode="Ideal"/>
                        <Separator Margin="0,0,0,10"/>
                        <WrapPanel Orientation="Horizontal">
                            <RadioButton Name="ClassicStyle" Height="185" Style="{StaticResource StyleItemRadioButton}" Padding="0,0,0,5" Click="CheckBoxClick">
                                <Image Source="/Resources/previews/classic_preview.png" RenderOptions.BitmapScalingMode="HighQuality"/>
                            </RadioButton>
                            <RadioButton Name="ModernStyle" Height="185" Style="{StaticResource StyleItemRadioButton}" Padding="0,0,0,5" Click="CheckBoxClick" Margin="5,0,0,0">
                                <Image Source="/Resources/previews/modern_preview.png" RenderOptions.BitmapScalingMode="HighQuality"/>
                            </RadioButton>
                            <!--<RadioButton Name="ModernWideStyle" Height="105" Style="{StaticResource StyleItemRadioButton}" Padding="0,0,0,5" Click="CheckBoxClick" Margin="5,0,0,0" VerticalAlignment="Bottom">
                                <Image Source="/Resources/previews/wide_preview.png" RenderOptions.BitmapScalingMode="HighQuality"/>
                            </RadioButton>-->
                        </WrapPanel>
                        <TextBlock Text="{x:Static Properties:Resources.OptionsAutoRestart}" Margin="0,5,0,0" Foreground="Gray" TextWrapping="Wrap"/>
                    </StackPanel>
                </ScrollViewer>
            </TabItem>
            <TabItem Header="Extras" Style="{StaticResource TabItemStyle}">
                <ScrollViewer VerticalScrollBarVisibility="Auto" Background="White">
                    <StackPanel Orientation="Vertical" Margin="10">
                        <TextBlock FontSize="24" FontWeight="Light" Text="HTC Home Extras" Foreground="{StaticResource OptionsBigHeaderColor}" TextOptions.TextFormattingMode="Ideal"/>
                        <Separator Margin="0,0,0,10"/>
                        <TextBlock Text="{x:Static Properties:Resources.OptionsExtrasInfo}" TextWrapping="Wrap" Foreground="Gray"/>
                        <TextBlock Text="{x:Static Properties:Resources.OptionsInstalledExtras}" Margin="0,3,0,0"/>
                        <ListView Name="ExtrasList" Margin="0,5,0,0" BorderThickness="0" SelectionChanged="ExtrasListSelectionChanged">
                            <ListView.View>
                                <GridView>
                                    <GridViewColumn Header="{x:Static Properties:Resources.OptionsExtrasTitle}" DisplayMemberBinding="{Binding Title}"/>
                                    <GridViewColumn Header="{x:Static Properties:Resources.OptionsExtrasDeveloper}" DisplayMemberBinding="{Binding Developer}"/>
                                    <GridViewColumn Header="{x:Static Properties:Resources.OptionsExtrasVersion}" DisplayMemberBinding="{Binding Version}"/>
                                </GridView>
                            </ListView.View>
                        </ListView>
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,5,7,0">
                            <Button Name="InstallExtButton" Content="{x:Static Properties:Resources.OptionsExtrasInstall}" Height="23" HorizontalAlignment="Right" Margin="0,0,7,0" Click="InstallExtButtonClick" Padding="10,0,10,0"/>
                            <Button Name="DeleteExtButton" Content="{x:Static Properties:Resources.OptionsExtrasDelete}" IsEnabled="False" Height="23" Click="DeleteExtButtonClick" Padding="10,0,10,0"/>
                        </StackPanel>

                        <TextBlock FontSize="24" FontWeight="Light" Text="{x:Static Properties:Resources.OptionsInstalledUpdates}" Foreground="{StaticResource OptionsBigHeaderColor}" TextOptions.TextFormattingMode="Ideal"/>
                        <Separator Margin="0,0,0,10"/>
                        <ListView Name="UpdatesList" Margin="0,5,0,0" BorderThickness="0">
                            <ListView.View>
                                <GridView>
                                    <GridViewColumn Header="{x:Static Properties:Resources.OptionsTitle}" DisplayMemberBinding="{Binding Title}"/>
                                </GridView>
                            </ListView.View>
                        </ListView>
                    </StackPanel>
                </ScrollViewer>
            </TabItem>
            <TabItem Header="{x:Static Properties:Resources.OptionsAboutTabHeader}" Style="{StaticResource TabItemStyle}">
                <ScrollViewer VerticalScrollBarVisibility="Auto" Background="White">
                    <StackPanel Orientation="Vertical" Margin="10">
                        <Grid>
                            <Image Width="48" Source="/Resources/logo.png" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,38,10,0" Opacity="1" RenderOptions.BitmapScalingMode="HighQuality"/>
                            <StackPanel Orientation="Vertical">
                                <TextBlock FontSize="24" FontWeight="Light" Text="{x:Static Properties:Resources.OptionsAboutWidget}" Foreground="{StaticResource OptionsBigHeaderColor}" TextOptions.TextFormattingMode="Ideal"/>
                                <Separator/>
                                <TextBlock Text="FriendStream Widget for HTC Home 3" Margin="0,7,0,0"/>
                                <TextBlock>
                                    <Run Text="{x:Static Properties:Resources.OptionsVersion}"/> 
                                    <Run Name="WidgetBuildTag" Text="3.0.0.0"/>
                                </TextBlock>
                                <TextBlock Text="Copyright © Stealth 2011"/>
                                <TextBlock Text="{x:Static Properties:Resources.OptionsCopyright}" TextWrapping="Wrap"/>
                            </StackPanel>
                        </Grid>
                        <Grid>
                            <Image Width="44" Source="/Home.Base;component/Resources/logo.png" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,48,10,0" Opacity="1" TextOptions.TextFormattingMode="Ideal"/>
                            <StackPanel Orientation="Vertical">
                                <TextBlock FontSize="24" FontWeight="Light" Text="{x:Static Properties:Resources.OptionsAboutHome}" Margin="0,10,0,0" Foreground="{StaticResource OptionsBigHeaderColor}"/>
                                <Separator/>
                                <TextBlock Text="HTC Home Apis"  Margin="0,7,0,0"/>
                                <TextBlock>
                                    <Run Text="{x:Static Properties:Resources.OptionsVersion}"/> 
                                    <Run Name="HomeBuildTag" Text="3.0.0.0"/>
                                </TextBlock>
                                <TextBlock Text="Copyright © Stealth 2011"/>
                                <TextBlock Text="{x:Static Properties:Resources.OptionsCopyright}" TextWrapping="Wrap"/>
                                <TextBlock Margin="0,10,0,0" TextWrapping="Wrap" Text="{x:Static Properties:Resources.OptionsLegalInfo}"/>
                                <TextBlock Name="SiteLink" TextWrapping="Wrap" Text="http://htchome.org" HorizontalAlignment="Right" MouseLeftButtonUp="SiteLinkMouseLeftButtonUp">
                                    <TextBlock.Style>
                                        <Style TargetType="{x:Type TextBlock}">
                                           <Setter Property="Cursor" Value="Hand"/>
                                           <Setter Property="Foreground" Value="#0066CC"/>
                                           <Style.Triggers>
                                                <Trigger Property="IsMouseOver" Value="True">
                                                    <Setter Property="TextDecorations" Value="Underline"/>
                                                    <Setter Property="Foreground" Value="#3399ff"/>
                                                </Trigger>
                                            </Style.Triggers>
                                        </Style>
                                    </TextBlock.Style>
                                </TextBlock>
                            </StackPanel>
                        </Grid>
                    </StackPanel>
                </ScrollViewer>
            </TabItem>
        </TabControl>
    </DockPanel>
</Window>
